package com.fox0g.mapper;

import com.fox0g.pojo.Sharebike;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 86176
* @description 针对表【sharebike(共享单车)】的数据库操作Mapper
* @createDate 2024-07-05 21:32:23
* @Entity com.fox0g.pojo.Sharebike
*/

@Mapper
public interface SharebikeMapper extends BaseMapper<Sharebike> {
    @Insert("insert into test.sharebike(id,v1,I1,subt,bikeid,batteryrfid, create_time)" +
            " values (#{id},#{v1},#{i1},#{subt},#{bikeid},#{batteryrfid},#{createTime})")
    int insert(Sharebike sharebike);

    @Select("select max(id) from test.sharebike")
    int selectid();

    @Select("select batteryrfid from test.sharebike where id = #{id}")
    String selectrfid(@Param("id") Integer id);

    @Select("select v1,I1,subt,bikeid,batteryrfid, create_time from test.sharebike where id = #{id}")
    Sharebike selectformation(@Param("id") Integer id);

    @Select("select v1,I1,subt,bikeid,batteryrfid, create_time from test.sharebike order by id desc ")
    List<Sharebike> allData();
}




